<template>
  <client-only placeholder="loading...">
    <ckeditor-nuxt v-model="contentHolder" :config="editorConfig" />
  </client-only>
</template>
<script lang="ts">

import { Vue, Component } from 'vue-property-decorator'
import WCustomUpload from './upload'
if (typeof window !== 'undefined') {
  require('@ckeditor/ckeditor5-build-classic/build/translations/zh-cn')
}
@Component({
  components: {
    'ckeditor-nuxt': () => import('@blowstack/ckeditor-nuxt')
  }
})
export default class CKEditor extends Vue {
  // 文本数据
  contentHolder = ''
  // 配置数据
  editorConfig = {
    // 语言
    language: 'zh-cn',
    extraPlugins: [WCustomUpload],
    title: {
      placeholder: '请输入文档标题'
    },
    placeholder: '请输入正文'
  }
}

</script>

<style scoped>

</style>
